package org.example.controller;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
//import lombok.extern.slf4j.Slf4j;
import org.example.config.CommonResult;
import org.example.entity.Shop;
import org.example.service.ShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

//@Slf4j
@RestController
@RequestMapping("v1/business")
public class ShopController {

    @Autowired
    private ShopService shopInfoList;

    @RequestMapping("shop")
    public CommonResult<IPage<Shop>> allShopList(
            @RequestParam(value = "curPage", defaultValue = "0") int current,
            @RequestParam(value = "size", defaultValue = "4") int  size) {
        IPage<Shop> shopIPage = shopInfoList.selectPageVo(current, size);
         return CommonResult.success(shopIPage);
//        return ResponseEntity.ok(shopIPage);
    }
}
